`use strict`
import { ref, reactive, onMounted } from 'vue'
import axios from 'axios'

export default () => {
    let url = 'https://dog.ceo/api/breed/pembroke/images/random'
    let dogName = ref('小柯基')
    let dogs = reactive([])
    const getDog = () => {
        axios.get(url).then(resp => {
            dogs.push(resp.data.message)
        })
    }
    onMounted(() => {
        getDog()
    })
    return {
        dogName,
        dogs,
        getDog
    }
}